<link rel="stylesheet" href="../src/lib/wang/wangeditor.css">

<title>成长档案</title>

<div class="layui-fluid upManager">
    <div class="layui-row">

        <div class="layui-col-md12">

            <div class="layui-card">
                <div class="layui-card-body">

                    <div id="postFormView"></div>

                </div>
            </div>
        </div>

    </div>
</div>


<script type="text/html" id="postFormTpl">
    <form action="" class="layui-form" lay-filter="component-form-group">
        <div class="layui-form-item">
            <label class="layui-form-label">标题</label>
            <div class="layui-input-block">
                <input type="text" name="title" lay-verify="title" autocomplete="off" placeholder="请输入标题"
                       class="layui-input" value="{{d.title}}">
            </div>
        </div>


        <div class="layui-form-item">
            <label class="layui-form-label">分类</label>
            <div class="layui-input-block">
                <select name="interest" lay-filter="aihao">
                    <option value=""></option>
                    <option value="0">写作</option>
                    <option value="1" selected="">阅读</option>
                    <option value="2">游戏</option>
                    <option value="3">音乐</option>
                    <option value="4">旅行</option>
                </select>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">正文</label>
            <div class="layui-input-block">
                <div id="wang" style="height: 500px;">
                    {{d.content}}
                </div>

            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <div class="layui-footer">
                    <button class="layui-btn" lay-submit="" lay-filter="component-form-demo1">立即提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        </div>

    </form>
</script>

<script>
    /*设置模块入口并加载后台公共模块*/
    layui.extend({
        wangeditor: '../lib/wang/wangeditor.min',
        app: 'app'
    }).use('app');

    layui.use(['admin', 'laytpl', 'form'], function () {
        var admin = layui.admin,
            laytpl = layui.laytpl,
            form = layui.form;
        var $ = layui.$;


        var getTpl = postFormTpl.innerHTML,
            view = document.getElementById('postFormView');

        laytpl(getTpl).render({
            "title": "打扫卫生",
            "class": "分类",
            "time": "2018-04-18 10:39:54",
            "id": 10000,
            "content": "aaaaa"
        }, function (html) {
            view.innerHTML = html;
        });

        form.render();


    });
</script>